/**
 * Class describing Deanery
 * 
 * @param address
 *            Deanery address
 * @param phoneNumber
 *            Deanery phone number
 * @author Paul Skorodzievskiy
 */
class Deanery {
	private String address;
	private String phoneNumber;

	public Deanery(String address, String phone) {
		this.address = address;
		this.phoneNumber = phone;
	}

	public String getDeaneryAddress() {
		return address;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public String setDeaneryaddress(String address) {
		return this.address = address;
	}

	public String setPhoneNumber(String phoneNumber) {
		return this.phoneNumber = phoneNumber;
	}

	/**
	 * Displays the working program
	 * 
	 * @param examSubject
	 *            academic discipline
	 */
	public void printCurriculum(Subject[] examSubject) {
		System.out.println("Curriculum:");
		for (Subject currentSubject : examSubject) {
			System.out.printf("Subject is \"%s\", hours = %s\n",
					currentSubject.getSubjectName(),
					currentSubject.getSubjectHours());
		}
	}

	public Group addGroup(String groupName) {
		return new Group(groupName);
	}

	/**
	 * Adding new students to the group
	 * 
	 * @param group
	 *            A group to which student should be added
	 * @param newStudent
	 *            Student to add
	 */
	public Student[] addStudent(Group group, Student newStudent) {
		Student[] students = group.getStudents();
		Student[] temp = new Student[students.length + 1];
		for (int i = 0; i < students.length; i++) {
			temp[i] = students[i];
		}
		temp[temp.length - 1] = newStudent;
		return students = temp;
	}

	/**
	 * Deleting student from a group
	 * 
	 * @param studentToDelete
	 *            Student to delete
	 */
	   public Student[] deleteStudent(Group group, Student studentToDelete){
		Student.deleteStudents();
		}
	   
	   
	public void printDeaneryContacts(Deanery deanery) {
		System.out.println("Deanery contacts:");
		System.out.printf("Deanery address is %s, phone number %s\n",
				dean.getDeaneryAddress(), dean.getPhoneNumber());
	}

}